﻿
using SurveySystem.Model;
using System.Collections.Generic;

namespace SurveySystem.Repository
{
    /// <summary>
    /// Repository interface for <see cref="Survey"/> objects
    /// </summary>
    public interface ISurveyRepository
    {

        /// <summary>
        /// Returns a survey with the given ID. If not found, null should be returned
        /// 
        /// NB: This method does NOT populate the Question list. See <see cref="Factory.SurveyFactory"/> for methods to populate this list
        /// </summary>
        /// <param name="surveyID"></param>
        /// <returns></returns>
        Survey GetSurveyByID(int surveyID);
        /// <summary>
        /// Returns a list of surveys which are active.
        /// 
        /// Active is defined as having a CloseDate which is null or greater than Now(), and the Closed flag set to false
        /// 
        /// NB: This method does NOT populate the Question list. See <see cref="Factory.SurveyFactory"/> for methods to populate this list
        /// </summary>
        /// <returns></returns>
        List<Survey> GetAllActiveSurveys();
        /// <summary>
        /// Returns a list of all surveys in the system, active and inactive. Care should be taken when using this method
        /// if the survey list is large
        /// 
        /// NB: This method does NOT populate the Question list. See <see cref="Factory.SurveyFactory"/> for methods to populate this list
        /// </summary>
        /// <returns></returns>
        List<Survey> GetAllSurveys();
        /// <summary>
        /// Adds a survey to the repository, populating the Survey.SurveyID field if appropriate
        /// 
        /// NB: This method does NOT add the survey's questions or answers. See <see cref="Factory.SurveyFactory"/> for methods to achieve this
        /// </summary>
        /// <param name="s"></param>
        void AddSurvey(Survey s);
        /// <summary>
        /// Updates the values of a survey which already exists in the repository
        /// 
        /// NB: This method does NOT update the survey's questions or answers. See <see cref="Factory.SurveyFactory"/> for methods to achieve this
        /// </summary>
        /// <param name="s"></param>
        void UpdateSurvey(Survey s);
        /// <summary>
        /// Removes a survey from the repository completely
        /// 
        /// NB: This method does NOT delete the survey's questions, answers or responses. See <see cref="Factory.SurveyFactory"/> for methods to achieve this
        /// </summary>
        /// <param name="surveyID"></param>
        void DeleteSurvey(int surveyID);
    }
}
